import {ref} from "vue";
import {defineStore} from "pinia";

export const giftStore=defineStore('giftStore', () => {
    const userModel=ref({
        id:-1,
        giftName:'',
        giftType:'',
        gbrand:'',
        gcolor:'',
        minStock:'',
        marketPrice:'',
        purchasePrice:'',
        giftNum:'',
        good:{}

    })
    return {userModel},
        {
            persist:{
                storage:sessionStorage,//把数据存入SessionStorage
                paths:['userModel']
            }

        }
})